#include "fat32/fat32.h"

#include <stdio.h>



void main()
{
	if (!fat32_init())
		return;

	fat32_findFirst(NULL);

	TFileInfo fi;

	int n = 0;

	while (fat32_findNext(&fi))
	{
		printf("%s\n", fi.fname);

/*		if ((fi.attr & 0x20)&&(fi.fname[0]=='L'))
		{
			fat32_open(&fi);

			for (int i=0; i<fi.size; i++)
			{
				printf("%c", fat32_readU8());
			}
			return;
		}*/

		if ((fi.attr & 0x10)&&(n++ == 3))
		{
			fat32_findFirst(&fi);
			while (fat32_findNext(&fi))
			{
				printf("%s\n", fi.fname);
			}

		}
	}
}